#include<stdio.h>
#include<math.h>

int main()
{
	int n =1;
	double pi =0.0,s=1.0,t=1;
	for(;(double)1/n>=1e-6;n+=2)
	{
		t = s/n;
		pi+=t;
		s=-s;
		
	}
	pi = pi*4;
	printf("pi=%f\n",pi);
	return 0;
	
}
